import comSpSkeleton from "../../engines/components/comSpSkeleton";

const {ccclass, property} = cc._decorator;

@ccclass
export default class LevelPagePre extends cc.Component {
    @property(cc.Prefab)
    md: cc.Prefab = null;

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        this.node.on(cc.Node.EventType.TOUCH_START,this.touchScene.bind(this));
    }

    start () {

    }

    // update (dt) {}

    touchScene(e:cc.Event.EventTouch){
        let pos:cc.Vec2 = e.getLocation();
        pos = this.node.convertToNodeSpaceAR(pos);
        // let node = cc.instantiate(this.md);
        // this.node.addChild(node);
        // node.setPosition(pos);
        // node.getComponent(comSpSkeleton).playAnimation("animation").start(false).onComplete(1,()=>{
        //     node.removeFromParent();
        // });
    }
}
